﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Security.Principal;
using System.Web;

namespace BlankMvc.Models {
	public static class ClaimsHelper {
		public static string GetEmail(this IIdentity identity) {
			var prinicpal = (ClaimsIdentity)identity;
			var email = prinicpal.Claims.Where(c => c.Type == ClaimTypes.Email).Select(c => c.Value).SingleOrDefault();
			return email;
		}
	}
}